package week02.day01;

public class 上机练习2 {
    public static void main(String[] args) {
        int number = 154;
        int num1 = number/100; // 获取百位数字
        int num2 = number%100/10; // 获取十位数字
        int num3 = number%10; // 获取个位数字
        int result = num1+num2+num3;
    
        System.out.println("数字之和为："+result);
    }
}
